package at.fhooe.engine.visuals;

import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.geom.Point2D;

public class RectangleVisual implements Visual {

	private Color m_color;
	private int m_width;
	private int m_height;
	private Point2D m_position;
	private boolean m_fill;
	
	public RectangleVisual(Color color, int width, int height, boolean fill){
		this(color, width, height, 0, 0, fill);
	}
	
	public RectangleVisual(Color color, int width, int height, double positionX, double positionY, boolean fill) {
		m_color = color;
		m_width = width;
		m_height = height;
		m_position = new Point2D.Double(positionX, positionY);
		m_fill = fill;
	}
	
	public void draw(Graphics2D graphics) {
		graphics.setColor(m_color);
		if(m_fill){
			graphics.fillRect((int)m_position.getX(), (int)m_position.getY(), m_width, m_height);
		} else{
			graphics.drawRect((int)m_position.getX(), (int)m_position.getY(), m_width, m_height);
		}
	}

}
